package com.usian.myclass.controller;

import com.usian.common.pojo.ResultVo;
import com.usian.myclass.service.ClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("class")
public class TbClassController {

    @Autowired
    private ClassService classService;

    @RequestMapping("info")
    public ResultVo info(int id){
        return new ResultVo(200,"success",classService.getById(id));
    }

    @RequestMapping("list")
    public ResultVo list(int collegeId){
        return new ResultVo(200,"success",classService.listByCollegeId(collegeId));
    }
}
